home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / xa / AdvancedPane.class (.txt) next >
Encoding:
Java Class File  |  2000-06-30  |  14.1 KB  |  536 lines

  1. package com.extensibility.xa;
  2.  
  3. import com.extensibility.app.BaseAction;
  4. import com.extensibility.app.UI;
  5. import com.extensibility.rock.RBevelBorder;
  6. import com.extensibility.rock.RTabbedPane;
  7. import com.extensibility.util.RuleSplitPane;
  8. import com.extensibility.xml.BaseDeclaration;
  9. import com.extensibility.xml.DataTypeDeclaration;
  10. import com.extensibility.xml.DeclarationChangeEvent;
  11. import com.extensibility.xml.ExternalGEDeclaration;
  12. import com.extensibility.xml.ExternalPEDeclaration;
  13. import com.extensibility.xml.ExternalSubset;
  14. import com.extensibility.xml.GeneralEntityDeclaration;
  15. import com.extensibility.xml.InternalGEDeclaration;
  16. import com.extensibility.xml.InternalPEDeclaration;
  17. import com.extensibility.xml.NamespaceDeclaration;
  18. import com.extensibility.xml.NotationDeclaration;
  19. import com.extensibility.xml.ParameterEntityDeclaration;
  20. import com.extensibility.xml.ProcessingInstruction;
  21. import com.extensibility.xml.SchemaFlavorIntf;
  22. import java.awt.BorderLayout;
  23. import java.awt.Component;
  24. import java.awt.Dimension;
  25. import java.awt.Font;
  26. import javax.swing.JComponent;
  27. import javax.swing.JPanel;
  28. import javax.swing.JScrollPane;
  29. import javax.swing.border.Border;
  30.  
  31. public class AdvancedPane extends CompositePane implements SchemaDocListener {
  32.    static final int MIN_WIDTH = 100;
  33.    static final int MIN_HEIGHT = 20;
  34.    public static final int TAB_GE = 0;
  35.    public static final int TAB_PE = 1;
  36.    public static final int TAB_NOTATION = 2;
  37.    public static final int TAB_DT = 3;
  38.    public static final int TAB_NS = 4;
  39.    public static final int TAB_PI = 5;
  40.    RTabbedPane tabPane;
  41.    EntityTable ipeTable;
  42.    EntityTable xpeTable;
  43.    RuleSplitPane peSplit;
  44.    JScrollPane ipeScroll;
  45.    JScrollPane xpeScroll;
  46.    EntityTable igeTable;
  47.    EntityTable xgeTable;
  48.    RuleSplitPane geSplit;
  49.    JScrollPane igeScroll;
  50.    JScrollPane xgeScroll;
  51.    NotationTable notTable;
  52.    JScrollPane notScroll;
  53.    PITable piTable;
  54.    JScrollPane piScroll;
  55.    NamespaceTable nsTable;
  56.    JScrollPane nsScroll;
  57.    DataTypeTable dtTable;
  58.    JScrollPane dtScroll;
  59.    // $FF: renamed from: jp javax.swing.JPanel
  60.    JPanel field_0;
  61.    DeclTable tableLastSelected;
  62.    public CutAction cutAction;
  63.    public CopyAction copyAction;
  64.    public PasteAction pasteAction;
  65.    public ClearAction clearAction;
  66.    public ExpandAction expandAction;
  67.  
  68.    public AdvancedPane(SchemaDoc var1) {
  69.       super(var1);
  70.       var1.addDocumentListener(this);
  71.       this.field_0 = new JPanel();
  72.       this.field_0.setBorder(new RBevelBorder(1));
  73.       this.field_0.setLayout(new BorderLayout());
  74.       this.ipeTable = new EntityTable(new EntityModel(var1, true, false));
  75.       this.ipeScroll = new JScrollPane(this.ipeTable);
  76.       this.ipeScroll.setBorder((Border)null);
  77.       this.ipeScroll.setHorizontalScrollBarPolicy(31);
  78.       this.ipeScroll.setVerticalScrollBarPolicy(22);
  79.       this.ipeScroll.setCorner("UPPER_RIGHT_CORNER", this.ipeTable.createCorner());
  80.       this.ipeScroll.setMinimumSize(new Dimension(100, 20));
  81.       this.xpeTable = new EntityTable(new EntityModel(var1, false, false));
  82.       this.xpeScroll = new JScrollPane(this.xpeTable);
  83.       this.xpeScroll.setBorder((Border)null);
  84.       this.xpeScroll.setMinimumSize(new Dimension(100, 20));
  85.       this.xpeScroll.setHorizontalScrollBarPolicy(31);
  86.       this.xpeScroll.setVerticalScrollBarPolicy(22);
  87.       this.xpeScroll.setCorner("UPPER_RIGHT_CORNER", this.xpeTable.createCorner());
  88.       this.igeTable = new EntityTable(new EntityModel(var1, true, true));
  89.       this.igeScroll = new JScrollPane(this.igeTable);
  90.       this.igeScroll.setBorder((Border)null);
  91.       this.igeScroll.setMinimumSize(new Dimension(100, 20));
  92.       this.igeScroll.setHorizontalScrollBarPolicy(31);
  93.       this.igeScroll.setVerticalScrollBarPolicy(22);
  94.       this.igeScroll.setCorner("UPPER_RIGHT_CORNER", this.igeTable.createCorner());
  95.       this.xgeTable = new EntityTable(new EntityModel(var1, false, true));
  96.       this.xgeScroll = new JScrollPane(this.xgeTable);
  97.       this.xgeScroll.setBorder((Border)null);
  98.       this.xgeScroll.setMinimumSize(new Dimension(100, 20));
  99.       this.xgeScroll.setHorizontalScrollBarPolicy(31);
  100.       this.xgeScroll.setVerticalScrollBarPolicy(22);
  101.       this.xgeScroll.setCorner("UPPER_RIGHT_CORNER", this.xgeTable.createCorner());
  102.       this.notTable = new NotationTable(new NotationModel(var1));
  103.       this.notScroll = new JScrollPane(this.notTable);
  104.       this.notScroll.setBorder((Border)null);
  105.       this.notScroll.setMinimumSize(new Dimension(100, 20));
  106.       this.notScroll.setHorizontalScrollBarPolicy(31);
  107.       this.notScroll.setVerticalScrollBarPolicy(22);
  108.       this.notScroll.setCorner("UPPER_RIGHT_CORNER", this.notTable.createCorner());
  109.       this.piTable = new PITable(new PIModel(var1));
  110.       this.piScroll = new JScrollPane(this.piTable);
  111.       this.piScroll.setBorder((Border)null);
  112.       this.piScroll.setMinimumSize(new Dimension(100, 20));
  113.       this.piScroll.setHorizontalScrollBarPolicy(31);
  114.       this.piScroll.setVerticalScrollBarPolicy(22);
  115.       this.piScroll.setCorner("UPPER_RIGHT_CORNER", this.piTable.createCorner());
  116.       this.peSplit = new RuleSplitPane(0, this.ipeScroll, this.xpeScroll);
  117.       this.peSplit.setDividerRule((double)0.5F);
  118.       this.peSplit.setBorder((Border)null);
  119.       this.geSplit = new RuleSplitPane(0, this.igeScroll, this.xgeScroll);
  120.       this.geSplit.setDividerRule((double)0.5F);
  121.       this.geSplit.setBorder((Border)null);
  122.       this.nsTable = new NamespaceTable(new NamespaceModel(var1));
  123.       this.nsScroll = new JScrollPane(this.nsTable);
  124.       this.nsScroll.setBorder((Border)null);
  125.       this.nsScroll.setHorizontalScrollBarPolicy(31);
  126.       this.nsScroll.setVerticalScrollBarPolicy(22);
  127.       this.nsScroll.setCorner("UPPER_RIGHT_CORNER", this.nsTable.createCorner());
  128.       this.dtTable = new DataTypeTable(new DataTypeModel(var1));
  129.       this.dtScroll = new JScrollPane(this.dtTable);
  130.       this.dtScroll.setBorder((Border)null);
  131.       this.dtScroll.setHorizontalScrollBarPolicy(31);
  132.       this.dtScroll.setVerticalScrollBarPolicy(22);
  133.       this.dtScroll.setCorner("UPPER_RIGHT_CORNER", this.dtTable.createCorner());
  134.       this.tabPane = new RTabbedPane();
  135.       Font var2 = UI.getAppFont();
  136.       if (var2 != null) {
  137.          this.tabPane.setFont(var2);
  138.       }
  139.  
  140.       this.tableLastSelected = this.ipeTable;
  141.       this.tabPane.addTab(UI.getString("tab.xmlvars.label"), UI.getIcon("tbGE.gif"), this.geSplit);
  142.       this.tabPane.addTab(UI.getString("tab.dtdvars.label"), UI.getIcon("tbPE.gif"), this.peSplit);
  143.       this.tabPane.addTab(UI.getString("tab.notations.label"), UI.getIcon("tbNT.gif"), this.notScroll);
  144.       this.tabPane.addTab(UI.getString("tab.dt.label"), UI.getIcon("tbDT.gif"), this.dtScroll);
  145.       this.tabPane.addTab(UI.getString("tab.ns.label"), UI.getIcon("tbNS.gif"), this.nsScroll);
  146.       this.tabPane.addTab(UI.getString("tab.pi.label"), UI.getIcon("tbPI.gif"), this.piScroll);
  147.       this.setTabs();
  148.       this.tabPane.addChangeListener(new 1(this));
  149.       this.field_0.add(this.tabPane, "Center");
  150.       this.ipeTable.addListSelectionListener(new 2(this));
  151.       this.xpeTable.addListSelectionListener(new 3(this));
  152.       this.igeTable.addListSelectionListener(new 4(this));
  153.       this.xgeTable.addListSelectionListener(new 5(this));
  154.       this.notTable.addListSelectionListener(new 6(this));
  155.       this.piTable.addListSelectionListener(new 7(this));
  156.       this.nsTable.addListSelectionListener(new 8(this));
  157.       this.dtTable.addListSelectionListener(new 9(this));
  158.       this.cutAction = new CutAction(this);
  159.       this.copyAction = new CopyAction(this);
  160.       this.pasteAction = new PasteAction(this);
  161.       this.clearAction = new ClearAction(this);
  162.       this.expandAction = new ExpandAction(this);
  163.       this.updateEditActions();
  164.    }
  165.  
  166.    public Class getCurrentClass() {
  167.       switch (this.getIDOfIndex(this.tabPane.getSelectedIndex())) {
  168.          case 0:
  169.             return Class.forName("com.extensibility.xml.GeneralEntityDeclaration");
  170.          case 1:
  171.             return Class.forName("com.extensibility.xml.ParameterEntityDeclaration");
  172.          case 2:
  173.             return Class.forName("com.extensibility.xml.NotationDeclaration");
  174.          case 3:
  175.             return Class.forName("com.extensibility.xml.DataTypeDeclaration");
  176.          case 4:
  177.             return Class.forName("com.extensibility.xml.NamespaceDeclaration");
  178.          case 5:
  179.             return Class.forName("com.extensibility.xml.ProcessingInstruction");
  180.          default:
  181.             return null;
  182.       }
  183.    }
  184.  
  185.    public JComponent getComponent() {
  186.       return this.field_0;
  187.    }
  188.  
  189.    public String getClassName() {
  190.       return "com.extensibility.xa.AdvancedPane";
  191.    }
  192.  
  193.    public void choose(Class var1) {
  194.       if (var1 == Class.forName("com.extensibility.xml.GeneralEntityDeclaration")) {
  195.          if (this.getIndexOf(0) < 0) {
  196.             ((CompositePane)this).beep();
  197.          } else {
  198.             this.tabPane.setSelectedIndex(this.getIndexOf(0));
  199.          }
  200.       } else if (var1 == Class.forName("com.extensibility.xml.ParameterEntityDeclaration")) {
  201.          if (this.getIndexOf(1) < 0) {
  202.             ((CompositePane)this).beep();
  203.          } else {
  204.             this.tabPane.setSelectedIndex(this.getIndexOf(1));
  205.          }
  206.       } else if (var1 == Class.forName("com.extensibility.xml.NotationDeclaration")) {
  207.          if (this.getIndexOf(2) < 0) {
  208.             ((CompositePane)this).beep();
  209.          } else {
  210.             this.tabPane.setSelectedIndex(this.getIndexOf(2));
  211.          }
  212.       } else if (var1 == Class.forName("com.extensibility.xml.ProcessingInstruction")) {
  213.          if (this.getIndexOf(5) < 0) {
  214.             ((CompositePane)this).beep();
  215.          } else {
  216.             this.tabPane.setSelectedIndex(this.getIndexOf(5));
  217.          }
  218.       } else if (var1 == Class.forName("com.extensibility.xml.NamespaceDeclaration")) {
  219.          if (this.getIndexOf(4) < 0) {
  220.             ((CompositePane)this).beep();
  221.          } else {
  222.             this.tabPane.setSelectedIndex(this.getIndexOf(4));
  223.          }
  224.       } else if (var1 == Class.forName("com.extensibility.xml.DataTypeDeclaration")) {
  225.          if (this.getIndexOf(3) < 0) {
  226.             ((CompositePane)this).beep();
  227.          } else {
  228.             this.tabPane.setSelectedIndex(this.getIndexOf(3));
  229.          }
  230.       }
  231.  
  232.    }
  233.  
  234.    protected void updateCurrentTable() {
  235.       int var1 = this.tabPane.getSelectedIndex();
  236.       if (var1 != -1) {
  237.          switch (this.getIDOfIndex(var1)) {
  238.             case 0:
  239.                if (this.xgeTable.getSelectedRow() >= 0) {
  240.                   this.tableLastSelected = this.xgeTable;
  241.                } else {
  242.                   this.tableLastSelected = this.igeTable;
  243.                }
  244.                break;
  245.             case 1:
  246.                if (this.xpeTable.getSelectedRow() >= 0) {
  247.                   this.tableLastSelected = this.xpeTable;
  248.                } else {
  249.                   this.tableLastSelected = this.ipeTable;
  250.                }
  251.                break;
  252.             case 2:
  253.                this.tableLastSelected = this.notTable;
  254.                break;
  255.             case 3:
  256.                this.tableLastSelected = this.dtTable;
  257.                break;
  258.             case 4:
  259.                this.tableLastSelected = this.nsTable;
  260.                break;
  261.             case 5:
  262.                this.tableLastSelected = this.piTable;
  263.          }
  264.  
  265.          this.updateEditActions();
  266.       }
  267.    }
  268.  
  269.    private void updateEditActions() {
  270.       this.cutAction.updateEnabled();
  271.       this.copyAction.updateEnabled();
  272.       this.pasteAction.updateEnabled();
  273.       this.clearAction.updateEnabled();
  274.    }
  275.  
  276.    public DeclTable getTableForClass(Class var1) {
  277.       if (var1 == Class.forName("com.extensibility.xml.InternalGEDeclaration")) {
  278.          return this.ipeTable;
  279.       } else if (var1 == Class.forName("com.extensibility.xml.ExternalGEDeclaration")) {
  280.          return this.xpeTable;
  281.       } else if (var1 == Class.forName("com.extensibility.xml.InternalPEDeclaration")) {
  282.          return this.igeTable;
  283.       } else if (var1 == Class.forName("com.extensibility.xml.ExternalPEDeclaration")) {
  284.          return this.xgeTable;
  285.       } else if (var1 == Class.forName("com.extensibility.xml.NotationDeclaration")) {
  286.          return this.notTable;
  287.       } else if (var1 == Class.forName("com.extensibility.xml.ProcessingInstruction")) {
  288.          return this.piTable;
  289.       } else if (var1 == Class.forName("com.extensibility.xml.NamespaceDeclaration")) {
  290.          return this.nsTable;
  291.       } else {
  292.          return var1 == Class.forName("com.extensibility.xml.DataTypeDeclaration") ? this.dtTable : null;
  293.       }
  294.    }
  295.  
  296.    public DeclTable getTableForModel(DeclTableModel var1) {
  297.       if (this.igeTable.getModel() == var1) {
  298.          return this.igeTable;
  299.       } else if (this.xgeTable.getModel() == var1) {
  300.          return this.xgeTable;
  301.       } else if (this.ipeTable.getModel() == var1) {
  302.          return this.ipeTable;
  303.       } else if (this.xpeTable.getModel() == var1) {
  304.          return this.xpeTable;
  305.       } else if (this.notTable.getModel() == var1) {
  306.          return this.notTable;
  307.       } else if (this.piTable.getModel() == var1) {
  308.          return this.piTable;
  309.       } else if (this.nsTable.getModel() == var1) {
  310.          return this.nsTable;
  311.       } else {
  312.          return this.dtTable.getModel() == var1 ? this.dtTable : null;
  313.       }
  314.    }
  315.  
  316.    public DeclTable getCurrentTable() {
  317.       return this.tableLastSelected;
  318.    }
  319.  
  320.    public int getSelectedTab() {
  321.       return this.tabPane.getSelectedIndex();
  322.    }
  323.  
  324.    public DeclTable getFirstTable(int var1) {
  325.       switch (var1) {
  326.          case 0:
  327.             return this.igeTable;
  328.          case 1:
  329.             return this.ipeTable;
  330.          case 2:
  331.             return this.notTable;
  332.          case 3:
  333.             return this.dtTable;
  334.          case 4:
  335.             return this.nsTable;
  336.          case 5:
  337.             return this.piTable;
  338.          default:
  339.             return null;
  340.       }
  341.    }
  342.  
  343.    public DeclTable getSecondTable(int var1) {
  344.       switch (var1) {
  345.          case 0:
  346.             return this.xgeTable;
  347.          case 1:
  348.             return this.xpeTable;
  349.          case 2:
  350.             return null;
  351.          case 3:
  352.          default:
  353.             return null;
  354.          case 4:
  355.             return null;
  356.          case 5:
  357.             return null;
  358.       }
  359.    }
  360.  
  361.    public boolean commitPendingEdits(boolean var1) {
  362.       boolean var2 = false;
  363.       var2 = var2 || !this.ipeTable.commitPendingEdits(var1);
  364.       var2 = var2 || !this.xpeTable.commitPendingEdits(var1);
  365.       var2 = var2 || !this.igeTable.commitPendingEdits(var1);
  366.       var2 = var2 || !this.xgeTable.commitPendingEdits(var1);
  367.       var2 = var2 || !this.notTable.commitPendingEdits(var1);
  368.       var2 = var2 || !this.piTable.commitPendingEdits(var1);
  369.       var2 = var2 || !this.nsTable.commitPendingEdits(var1);
  370.       var2 = var2 || !this.dtTable.commitPendingEdits(var1);
  371.       return !var2;
  372.    }
  373.  
  374.    protected BaseAction createCutAction() {
  375.       return this.cutAction;
  376.    }
  377.  
  378.    protected BaseAction createCopyAction() {
  379.       return this.copyAction;
  380.    }
  381.  
  382.    protected BaseAction createPasteAction() {
  383.       return this.pasteAction;
  384.    }
  385.  
  386.    protected BaseAction createClearAction() {
  387.       return this.clearAction;
  388.    }
  389.  
  390.    protected BaseAction createExpandAction() {
  391.       return this.expandAction;
  392.    }
  393.  
  394.    public int getTabOfDecl(BaseDeclaration var1) {
  395.       if (var1 instanceof GeneralEntityDeclaration) {
  396.          return 0;
  397.       } else if (var1 instanceof ParameterEntityDeclaration) {
  398.          return 1;
  399.       } else if (var1 instanceof ExternalSubset) {
  400.          return 1;
  401.       } else if (var1 instanceof NotationDeclaration) {
  402.          return 2;
  403.       } else if (var1 instanceof ProcessingInstruction) {
  404.          return 5;
  405.       } else if (var1 instanceof NamespaceDeclaration) {
  406.          return 4;
  407.       } else {
  408.          return var1 instanceof DataTypeDeclaration ? 3 : -1;
  409.       }
  410.    }
  411.  
  412.    public boolean select(BaseDeclaration var1) {
  413.       return this.select(var1, true);
  414.    }
  415.  
  416.    public boolean select(BaseDeclaration var1, boolean var2) {
  417.       if (!var2 && this.tabPane.getSelectedIndex() != this.getTabOfDecl(var1)) {
  418.          this.getCurrentTable().select((BaseDeclaration)null);
  419.          return false;
  420.       } else {
  421.          if (var1 instanceof InternalGEDeclaration) {
  422.             this.tabPane.setSelectedIndex(0);
  423.             this.igeTable.select(var1);
  424.          } else if (var1 instanceof ExternalGEDeclaration) {
  425.             this.tabPane.setSelectedIndex(0);
  426.             this.xgeTable.select(var1);
  427.          } else if (var1 instanceof InternalPEDeclaration) {
  428.             this.tabPane.setSelectedIndex(1);
  429.             this.ipeTable.select(var1);
  430.          } else if (var1 instanceof ExternalSubset) {
  431.             if (!var2 && this.tabPane.getSelectedIndex() != 1) {
  432.                return false;
  433.             }
  434.  
  435.             this.tabPane.setSelectedIndex(1);
  436.             this.xpeTable.select(((CompositePane)this).getSchemaDoc().getNamedDeclaration(var1.getName(), Class.forName("com.extensibility.xml.ParameterEntityDeclaration")));
  437.          } else if (var1 instanceof ExternalPEDeclaration) {
  438.             this.tabPane.setSelectedIndex(1);
  439.             this.xpeTable.select(var1);
  440.          } else if (var1 instanceof NotationDeclaration) {
  441.             this.tabPane.setSelectedIndex(2);
  442.             this.notTable.select(var1);
  443.          } else if (var1 instanceof ProcessingInstruction) {
  444.             this.tabPane.setSelectedIndex(5);
  445.             this.piTable.select(var1);
  446.          } else if (var1 instanceof NamespaceDeclaration) {
  447.             this.tabPane.setSelectedIndex(4);
  448.             this.nsTable.select(var1);
  449.          } else {
  450.             if (!(var1 instanceof DataTypeDeclaration)) {
  451.                return false;
  452.             }
  453.  
  454.             this.tabPane.setSelectedIndex(3);
  455.             this.dtTable.select(var1);
  456.          }
  457.  
  458.          return true;
  459.       }
  460.    }
  461.  
  462.    public void declarationRemoved(SchemaDocEvent var1) {
  463.    }
  464.  
  465.    public void declarationInserted(SchemaDocEvent var1) {
  466.    }
  467.  
  468.    public void declarationListChanged(SchemaDocEvent var1) {
  469.    }
  470.  
  471.    public void declarationListReordered(SchemaDocEvent var1) {
  472.    }
  473.  
  474.    public void declarationChanged(SchemaDocEvent var1, DeclarationChangeEvent var2) {
  475.    }
  476.  
  477.    public void flavorChanged(SchemaDocEvent var1) {
  478.       this.setTabs();
  479.       this.updateCurrentTable();
  480.    }
  481.  
  482.    private void setTabs() {
  483.       SchemaFlavorIntf var1 = ((CompositePane)this).getSchemaDoc().getSchema().getFlavor();
  484.       this.tabPane.setEnabledAt(this.getIndexOf(0), var1.isSupported(Class.forName("com.extensibility.xml.GeneralEntityDeclaration")));
  485.       this.tabPane.setEnabledAt(this.getIndexOf(1), var1.isSupported(Class.forName("com.extensibility.xml.ParameterEntityDeclaration")));
  486.       this.tabPane.setEnabledAt(this.getIndexOf(2), var1.isSupported(Class.forName("com.extensibility.xml.NotationDeclaration")));
  487.       this.tabPane.setEnabledAt(this.getIndexOf(5), var1.isSupported(Class.forName("com.extensibility.xml.ProcessingInstruction")));
  488.       this.tabPane.setEnabledAt(this.getIndexOf(4), var1.isSupported(Class.forName("com.extensibility.xml.NamespaceDeclaration")));
  489.       this.tabPane.setEnabledAt(this.getIndexOf(3), var1.isSupported(Class.forName("com.extensibility.xml.DataTypeDeclaration")));
  490.    }
  491.  
  492.    private int getIndexOf(int var1) {
  493.       switch (var1) {
  494.          case 0:
  495.             return this.tabPane.indexOfComponent(this.geSplit);
  496.          case 1:
  497.             return this.tabPane.indexOfComponent(this.peSplit);
  498.          case 2:
  499.             return this.tabPane.indexOfComponent(this.notScroll);
  500.          case 3:
  501.             return this.tabPane.indexOfComponent(this.dtScroll);
  502.          case 4:
  503.             return this.tabPane.indexOfComponent(this.nsScroll);
  504.          case 5:
  505.             return this.tabPane.indexOfComponent(this.piScroll);
  506.          default:
  507.             return -1;
  508.       }
  509.    }
  510.  
  511.    private int getIDOfIndex(int var1) {
  512.       Component var2 = this.tabPane.getComponentAt(var1);
  513.       if (var2 == null) {
  514.          return -1;
  515.       } else if (var2 == this.geSplit) {
  516.          return 0;
  517.       } else if (var2 == this.peSplit) {
  518.          return 1;
  519.       } else if (var2 == this.notScroll) {
  520.          return 2;
  521.       } else if (var2 == this.piScroll) {
  522.          return 5;
  523.       } else if (var2 == this.nsScroll) {
  524.          return 4;
  525.       } else {
  526.          return var2 == this.dtScroll ? 3 : -1;
  527.       }
  528.    }
  529.  
  530.    public void focusDeclaration(BaseDeclaration var1) {
  531.       if (var1 != this.getCurrentTable().getSelectedDecl()) {
  532.          this.select(var1, false);
  533.       }
  534.    }
  535. }
  536.